<script type='text/javascript'>
	function update() {
		app.post('/services/companies/update/{{company.slug}}', {
			email       : $('#email').val(),
			address     : $('#address').val(),
			phone       : $('#phone').val(),
			website     : $('#website').val(),
			description : $('#description').val()		
		},function(result){
			if(result == 'ok') {
				app.load('/services/companies');
			}
			else{
				alert(result);
			}
		});
	}
	$(document).ready(function(){
	});
</script>

<div id='menu'>
	<ul>
		<li><a href='javascript:app.load("/services/companies")'>go back</a></li>
	</ul>
</div>

<div id='content'>

	<h1>update company</h1>	

	<fieldset>
		<div class='field-row'>
			<label>name</label>
			<span>{{company.name}}</span>
		</div>
		<div class='field-row'>
			<label>email</label>
			<input type='text' id='email' value='{{company.email}}' />
		</div>
		<div class='field-row'>
			<label>website</label>
			<input type='text' id='website' value={{company.website}} />
		</div>
		<div class='field-row'>
			<label>phone</label>
			<input type='text' id='phone' value='{{company.phone}}'/> 
		</div>
		<div class='field-row'>
			<label>address</label>
			<textarea id='address'>{{company.address}}</textarea>
		</div>
		<div class='field-row'>
			<label>description</label>
			<textarea id='description'>{{company.description}}</textarea>
		</div>
		<div class='field-row'>
			<label>&nbsp;</label>
			<a href='javascript:update()'>update</a>
		</div>	
	</fieldset>
		
</div>